home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
coding
/
dsp
/
aib2xmpl.exe
/
ADDA_CC.C
< prev
next >
Wrap
Text File
|
1991-07-31
|
1KB
|
43 lines
/**************************************************************
adda_cc.c
staff
7-31-91
(C) Texas Instruments Inc., 1992
Refer to the file 'license.txt' included with this
this package for usage and license information.
*************************************************************/
#include <math.h>
void set_rate(int);
void tcv_adda(void);
int ratevalue(long int);
/* THE VALUE OF THE SAMPLING FREQUENCY CAN BE CHANGED TO ANY VALUE UP TO */
/* 58823 HZ, CORRESPONDING TO A 17uS SAMPLING PERIOD. */
long int SampFreq = 12500; /* 12.5 KHZ */
int a, b;
void main(void)
{
set_rate(ratevalue(SampFreq)); /* SEND THE VALUE TO THE SRC. */
for(;;) /* CONTINUALLY TRANSMIT AND */
{ /* RECEIVE DATA. */
tcv_adda();
}
}
int ratevalue(long int SampFreq) /* THIS IS THE FORMULA FOR THE */
{ /* DETERMINATION OF THE SAMPLE */
b = 5e6 / SampFreq; /* RATE CLOCK VALUE FROM THE */
return (int) (65535 - b); /* SAMPLING RATE. */
}